import React from 'react';
import { Tooltip } from 'antd';
import { QuestionCircleOutlined } from '#/utils/antdIcons';
import styles from './index.less';

export default ({ title, tooltip, right = null }) => {
  return (
    <div className={styles.tj_title}>
      <div className={styles.flex}>
        <div>{title}</div>
        <Tooltip placement="topLeft" title={tooltip}>
          <QuestionCircleOutlined className={styles.icon} style={{ color: '#ff5959' }} />
        </Tooltip>
      </div>
      {!!right && <div className={styles.flex}>{right}</div>}
    </div>
  );
};
